{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>商家列表</strong></li>
	</ol>
</div>
<div class="ibox float-e-margins">
	<div class="ibox-content">
		<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('index')}">
            <div class="form-group">
            	<label class="col-sm-1 control-label">商户名</label>
	            <div class="input-group  col-sm-7">
	                 <input type="text" name='store_name' class="form-control"> <span class="input-group-btn"> <button type="submit" class="btn btn-primary">搜索
	                </button> </span>
	            </div>
            </div>
            <div class="form-group">
            	   	<label class="col-sm-1 control-label">手机号码</label>
              <div class="input-group col-sm-5">
                 <input type="text" name='store_tel' class="form-control"> 
         	   </div>
            </div>
            <div class="form-group">
						<label class="col-sm-1 control-label">地理位置</label>
						<div class="input-group col-sm-10">
							<div class="row" style="margin-left: 5px;">
								<select id="s_province" name="province" class="form-control" style="width: 130px;"></select>
								<select id="s_city" name="city" class="form-control" style="width: 130px;"></select>
								<select id="s_county" name="district" class="form-control" style="width: 130px;"></select>
							</div>
						</div>
			</div>
        </form>
		<a href="{:url('add')}" class="btn btn-xs btn-info"><i class="fa fa-plus"></i>新增</a>
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                                <th>商户名</th>
                                <th>行业</th>
                                <th>余额</th>
                                <th>积分</th>
                                <th>联系电话</th>
                                <th>地址</th>
                                <th>充值</th>
                            </tr>
                        </thead>
                        <tbody id="list">
                        	{volist name="list" id='ad'}
                        	<tr>
                        		<td><a href="{:url('edit',['id'=>$ad.id])}" >{$ad.store_name}</a></td>
                        		<td >
                        			{$ad.title}
                        		</td>
                        		<td >
                        			{$ad.store_balance}
                        		</td>
                        		<td id="score_{$ad.id}">
                        			{$ad.score}
                        		</td>
                        		<td >
                        			{$ad.store_tel}
                        		</td>
                        		<td >
                        			{$ad.address}
                        		</td>
                        		<td >
                        			<a href="#" onclick="chongzhi({$ad.id},2)">积分充值</a>
                        		</td>
                        	</tr>
                        	{/volist}
                        </tbody>
                    </table>
                    <div style="text-align: right;">
                      {$list->render()}
                    </div>
                </div>
            </div>
            </div>
</div>
{/block} {block name="script"}
<script class="resources library" src="__PLUGIN__/area/area.js" type="text/javascript"></script>
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script>
	_init_area();
	var Gid = document.getElementById;
	function update_dis(obj){
		var value = $(obj).val();
		var chk=$(obj).is(':checked');
			$.ajax({
				type:"post",
				data:{id:$(obj).data("id"),is_distribution:value==1?0:1},
				url:"update_agent",
				success:function(data){
					layer.msg(data.msg);
					if(data.code==200){
						$(obj).val(value==1?0:1);
					}
				}
			});
	}
	function update_xs(obj){
		var value = $(obj).val();
		var chk=$(obj).is(':checked');
			$.ajax({
				type:"post",
				data:{id:$(obj).data("id"),is_display:value==1?0:1},
				url:"update_agent",
				success:function(data){
					layer.msg(data.msg);
					if(data.code==200){
						$(obj).val(value==1?0:1);
					}
				}
			});
	}	
	
</script>
<style>
.bank{
	width: 150px;
    height:30px;
    border-radius:5px;
}
</style>
{/block}